package com.whyl.eems.controller;

import com.whyl.eems.UserInfoISV;
import com.whyl.eems.config.DubboConstants;
import org.apache.dubbo.config.annotation.Reference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test/")
public class UserInfoController {
    private static final Logger logger = LoggerFactory.getLogger(UserInfoController.class);

    @Reference(version = DubboConstants.VERSION_1_0)
    private UserInfoISV userInfoISV;

    @GetMapping("/hello/{name}")
    public Object sayHello(@PathVariable("name") String name) {
        logger.info(userInfoISV.toString());
        return userInfoISV.sayHello(name);
    }
}